import Vue from 'vue'
import Router from 'vue-router'
import index from 'components/pages/index/index'
import Register from 'components/pages/register/register'
import Login from 'components/pages/login/login'
import Goods from 'components/pages/goods/goods'
import CategoryList from 'components/pages/categoryList/categoryList'
import Layout from 'components/pages/layout/layout'
Vue.use(Router)

export default new Router({
  routes: [
    {
      path: '/main',
      name: 'Layout',
      component: Layout,
      children: [
        {
          path: '/',
          name: 'index',
          component: index
        },
        {
          path: '/categoryList',
          name: 'CategoryList',
          component: CategoryList
        }
      ]
    },
    {
      path: '/register',
      name: 'Register',
      component: Register
    },
    {
      path: '/login',
      name: 'Login',
      component: Login
    },
    {
      path: '/goods/:id',
      name: 'Goods',
      component: Goods
    },
    {
      path: '/categoryList',
      name: 'CategoryList',
      component: CategoryList
    }
  ]
})
